import { request } from "@/utils/request";
import Qs from "qs";

/**
 * app主播端 扫描楼层 查询商品列表（已上架）
 * @param data
 * @returns {*}
 */

export const getSelectionList = (data) => {
    return request({
        url: "/basic/selection/getSelectionList",
        method: "post",
        data
    });
};
// 查询楼层信息
export const getFloor = (data) => {
    return request({
        url: "/basic/selection/getFloor",
        method: "post",
        data
    });
};
/**
 * app主播端 加入购物车
 * @param data
 * @returns {*}
 */

export const addShoppingCart = (data) => {
    return request({
        url: "/basic/selection/addShoppingCart",
        method: "post",
        data
    });
};
/**
 * app主播端 点击购物车查看购车中的数据
 * @param data
 * @returns {*}
 */

export const getShoppingByUserId = (data) => {
    return request({
        url: "/basic/selection/getShoppingByUserId",
        method: "post",
        data
    });
};
/**
 * app主播端 购物车中单个删除
 * @param data
 * @returns {*}
 */

export const deleteShoppingProduct = (data) => {
    return request({
        url: "/basic/selection/deleteShoppingProduct",
        method: "post",
        data
    });
};
/**
 * app主播端 清空购物车
 * @param data
 * @returns {*}
 */

export const deleteShoppingAll = (data) => {
    return request({
        url: "/basic/selection/deleteShoppingAll",
        method: "post",
        data
    });
};

/**
 * app主播端 首页 - 数据简报 - 统计的数字
 * @param data
 * @returns {*}
 */

export const statisticsPut = (data) => {
    return request({
        url: "/basic/stockOut/statisticsPut",
        method: "post",
        data
    });
};
// 首页代办统计数字
export const loanCount = (params) => {
    return request({
        url: "/basic/loan/loanCount",
        method: "get",
        params
    });
};
/**
 * app主播端 购物车提交
 * @param data
 * @returns {*}
 */

export const shoppingSubmit = (data) => {
    return request({
        url: "/basic/selection/shoppingSubmit",
        method: "post",
        data
    });
};
/**
 * 查询通知列表
 * @param data
 * @returns {*}
 */

export const queryIndividualMsg = (data) => {
    return request({
        url: "/basic/messageRecord/queryIndividualMsg",
        method: "post",
        data
    });
};
/**
 * 阅读消息
 * @param data
 * @returns {*}
 */

export const readList = (data) => {
    return request({
        url: "/basic/myCenter/readList",
        method: "post",
        data
    });
};

// 代办任务-借调处理
export const getAuditLoanList = (data) => {
    return request({
        url: "/basic/loan/getAuditLoanList",
        method: "post",
        data
    });
};

// 运营端商品借调列表
export const getProductList = (data: any) => {
    return request({
        url: '/basic/loan/getProductList',
        method: 'post',
        headers: { "Content-Type": "application/x-www-form-urlencoded" },
        data: Qs.stringify(data),
    });
};


// 运营端商品借调列表详情
export const loanLook = (id: any) => {
    return request({
        url: `/basic/loan/${id}`,
        method: 'get'
    });
};

// 运营端商品借调列表详情借调
export const loanAdd = (data: any) => {
    return request({
        url: '/basic/loan',
        method: 'post',
        data
    });
};

// 运营端发起借调记录
export const getStartLoanList = (data: any) => {
    return request({
        url: '/basic/loan/getStartLoanList',
        method: 'post',
        data
    });
};

// 运营端发起借调记录详情
export const getLoanDetail = (params: any) => {
    return request({
        url: '/basic/loan/getLoanDetail',
        method: 'get',
        params
    });
};

// 运营端撤销
export const loanRepeal = (params: any) => {
    return request({
        url: '/basic/loan',
        method: 'get',
        params
    });
};

// 代办任务-借调处理-拒绝
export const refuseLoan = (data: any) => {
    return request({
        url: '/basic/loan/refuseLoan',
        method: 'post',
        data
    });
};

// 代办任务-借调处理-通过
export const passLoan = (data: any) => {
    return request({
        url: '/basic/loan/passLoan',
        method: 'post',
        data
    });
};

// 代办任务-借调历史列表
export const getHistoryLoanList = (data: any) => {
    return request({
        url: '/basic/loan/getHistoryLoanList',
        method: 'post',
        data
    });
};
// 运营端代办工作-代还品数量
export const homeAgencyReturned = (data: any) => {
    return request({
        url: '/basic/selectionData/homeAgencyReturned',
        method: 'post',
        data
    });
};
// 运营端代办工作-补样进度数量
export const homeSampleNum = (data: any) => {
    return request({
        url: '/basic/selectionData/homeSampleNum',
        method: 'post',
        data
    });
};

// 运营端代办工作-待还品下钻列表
export const homeAgencyReturnedList = (data: any) => {
    return request({
        url: '/basic/selectionData/homeAgencyReturnedList',
        method: 'post',
        data
    });
};

// 运营端数据简报下钻列表-招商选品
export const selectRecruiterSelection = (data: any) => {
    return request({
        url: '/basic/selectionData/selectRecruiterSelection',
        method: 'post',
        data
    });
};
// 运营端数据简报下钻列表- 产品出库 
export const selectStockOut = (data: any) => {
    return request({
        url: '/basic/selectionData/selectStockOut',
        method: 'post',
        data
    });
};
// 运营端数据简报下钻列表- 如期还品 /超期还品 
// 如期超期   status 0 如期  1 超期
export const selectStatisticsPutList = (data: any) => {
    return request({
        url: '/basic/selectionData/selectStatisticsPutList',
        method: 'post',
        data
    });
};

// 运营端-选品出库-周选品概况
export const getSelectionStatistics = (data: any) => {
    return request({
        url: '/basic/selectionData/getSelectionStatistics',
        method: 'post',
        data
    });
};

// 运营端-选品出库-招商选品
export const selectAttract = (data: any) => {
    return request({
        url: '/basic/selectionData/selectAttract',
        method: 'post',
        data
    });
};

// 运营-选品出库-研发选品
export const selectInventSelection = (data: any) => {
    return request({
        url: '/basic/selectionData/selectInventSelection',
        method: 'post',
        data
    });
};

// 运营端-选品出库-产品出库
export const selectOutStatistics = (data: any) => {
    return request({
        url: '/basic/selectionData/selectOutStatistics',
        method: 'post',
        data
    });
};

// 运营端-选品出库-产品出库-全部列表
export const selectOutList = (data: any) => {
    return request({
        url: '/basic/selectionData/selectOutList',
        method: 'post',
        data
    });
};

// 运营端-选品出库-产品出库-单独列表
export const selectOutById = (data: any) => {
    return request({
        url: '/basic/selectionData/selectOutById',
        method: 'post',
        data
    });
};

// 运营端-选品出库-招商选品-单独列表
export const selectRecruiterDeptId = (data: any) => {
    return request({
        url: '/basic/selectionData/selectRecruiterDeptId',
        method: 'post',
        data
    });
};

// 运营端-选品出库-招商选品-单独列表-详情
export const selectRecruiterDetailed = (data: any) => {
    return request({
        url: '/basic/selectionData/selectRecruiterDetailed',
        method: 'post',
        data
    });
};

// 运营端-不还说明提交
export const submitNoRemark = (data: any) => {
    return request({
        url: '/basic/selectionData/submitNoRemark',
        method: 'post',
        data
    });
};

// 运营端-选品出库-产品出库-单独列表-详情
export const selectByOutId = (data: any) => {
    return request({
        url: '/basic/selectionData/selectByOutId',
        method: 'post',
        data
    });
};

// 运营端-我的-周选品次数
export const getWeekCount = (data: any) => {
    return request({
        url: '/basic/selectionData/getWeekCount',
        method: 'post',
        data
    });
};
// 招商经理楼层码
export const qrCode = () => {
    return request({
        url: '/basic/qrCode',
        method: 'get',
        responseType: 'arraybuffer',
    });
};
// 招商经理楼层
export const getQrCodeDeptName = (data: any) => {
    return request({
        url: '/basic/selectionData/getQrCodeDeptName',
        method: 'post',
        data
    });
};

// 运营端消息通知
export const queryDeptMsg = (data: any) => {
    return request({
        url: '/basic/myCenter/queryDeptMsg',
        method: 'post',
        data
    });
};

// 运营端消息通知-数量
export const queryDeptCount = (data: any) => {
    return request({
        url: '/basic/myCenter/queryDeptCount',
        method: 'post',
        data
    });
};
// 产品端周统计-数量
export const getWeekData = (data: any) => {
    return request({
        url: 'basic/stockProduct/getWeekData',
        method: 'post',
        data
    });
};


// 运营-招商选品扫码-研发选品扫码-验证二维码时效
export const getSelectionTimeList = (data: any) => {
    return request({
        url: '/basic/selection/getSelectionTimeList',
        method: 'post',
        data
    });
};

// 运营-反馈与建议
export const ideasAndFeedback = (data: any) => {
    return request({
        url: '/basic/ideasAndFeedback',
        method: 'post',
        data
    });
};
// 运营-上传头像
export const editAvatar = (id: string) => {
    return request({
        url: '/basic/myCenter/editAvatar?avatarUrl=' + id,
        method: 'get'
    });
};

// 消息通知信息删除
export const deleteList = (data: any) => {
    return request({
        url: '/basic/myCenter/deleteList',
        method: 'post',
        data
    });
};

// 代办消息变成已读
export const readHandle = (data: any) => {
    return request({
        url: '/basic/myCenter/readHandle',
        method: 'get',
        params: data
    });
};

// 运营端补样邀约列表
export const getOutStockList = (data: any) => {
    return request({
        url: '/basic/sampleAudit/getOutStockList',
        method: 'post',
        data
    });
};
// 运营端补样邀约详情
export const sampleAuditByid = (data: any) => {
    return request({
        url: '/basic/sampleAudit/getById',
        method: 'post',
        data
    });
};

// 运营端发起邀约
export const addSampleAudit = (data: any) => {
    return request({
        url: '/basic/sampleAudit/addSampleAudit',
        method: 'post',
        data
    });
};

// 运营端审批中心 查补样列表
export const getSampleList = (data: any) => {
    return request({
        url: '/basic/sampleAudit/getSampleList',
        method: 'post',
        data
    });
};

// 运营端审批中心 查补样列表详情
export const getDetailedById = (data: any) => {
    return request({
        url: '/basic/sampleAudit/getDetailedById',
        method: 'post',
        data
    });
};


// 产品app 点击 审批数据  查补样审批列表
export const getStockSampleList = (data: any) => {
    return request({
        url: '/basic/sampleAudit/getStockSampleList',
        method: 'post',
        data
    });
};

// 产品app 点击 审批数据  查补样审批列表 详情
export const getStockSampleById = (data: any) => {
    return request({
        url: '/basic/sampleAudit/getStockSampleById',
        method: 'post',
        data
    });
};
// 产品app 点击 审批数据  查补样审批列表 详情 驳回
export const refuse = (data: any) => {
    return request({
        url: '/basic/sampleAudit/refuse',
        method: 'post',
        data
    });
};

// 产品app 点击 审批数据  查补样审批列表 详情 通过
export const pass = (data: any) => {
    return request({
        url: '/basic/sampleAudit/pass',
        method: 'post',
        data
    });
};









